<?php
if (! defined('SIMPLE_TEST')) {
    define('SIMPLE_TEST', '../../../../simpletest/');
}
require_once(SIMPLE_TEST . 'unit_tester.php');
require_once(SIMPLE_TEST . 'reporter.php');
require_once('../blip-php.php');

class TestOfBlipFileInfo extends UnitTestCase {
    function setUp() {
    }
    
    function TestOfBlipFileInfo() {
        $this->UnitTestCase();
    }
    
    function test_file_info() {
        $blip = new BlipPHP();
        
        $response = $blip->file_info($id = "2277793");
        
        $this->assertEqual("2290749", $response->payload->asset->id[0]);
        $this->assertEqual("2277793", $response->payload->asset->item_id[0]);
        $this->assertEqual("false", $response->payload->asset->deleted[0]);
        $this->assertEqual("file", $response->payload->asset->item_type[0]);
        
        /* Good enough */
    }
    
    function test_file_info_no_id() {
        $blip = new BlipPHP();
        
        $this->expectException('BlipDataException');
        $response = $blip->file_info();
    }
    
    function test_file_info_blank_id() {
        $blip = new BlipPHP();
        
        $this->expectException('BlipDataException');
        $response = $blip->file_info($id = "");
    }
}

$test = &new TestOfBlipFileInfo();
$test->run(new HtmlReporter());
?>